#!/usr/bin/env python
# -*- coding: utf-8 -*-

import pysvn


def is_svn_path(path):
    client = pysvn.Client()
    try:
        # root_url = client.root_url_from_path(path)
        lst = client.status(path, recurse=False)
        return len(lst) > 0
    except pysvn.ClientError, e:
        print e
        return False


def checkout(url, path):
    client = pysvn.Client()
    try:
        client.checkout(url, path)
        return True
    except pysvn.ClientError, e:
        print e
        return False
